package com.JdkProxy.secondexample.utils;

/**
 * @User c.c
 * @Since 2022/11/25
 * @Time 9:01
 * @Description 计时工具
 */

public class TimingUtils {
  private static ThreadLocal<Long> tl = new ThreadLocal();

  public static void start() {
    tl.set(System.currentTimeMillis());
  }

  public static void end(String name){
    long finishTime = System.currentTimeMillis();
    System.out.println("方法"+name+"耗时："+(finishTime-tl.get()));
  }

}
